3.1.29 \(\int (a+b \cot ^2(x))^{3/2} \tan (x) \, dx\) [29]

3.1.29.1 Optimal result
3.1.29.2 Mathematica [A] (verified)
3.1.29.3 Rubi [A] (verified)
3.1.29.4 Maple [B] (verified)
3.1.29.5 Fricas [A] (verification not implemented)
3.1.29.6 Sympy [F]
3.1.29.7 Maxima [F]
3.1.29.8 Giac [F(-2)]
3.1.29.9 Mupad [B] (verification not implemented)

3.1.29.1 Optimal result

Integrand size = 15, antiderivative size = 75 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan (x) \, dx=a^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )-(a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right )-b \sqrt {a+b \cot ^2(x)} \]

output
a^(3/2)*arctanh((a+b*cot(x)^2)^(1/2)/a^(1/2))-(a-b)^(3/2)*arctanh((a+b*cot 
(x)^2)^(1/2)/(a-b)^(1/2))-b*(a+b*cot(x)^2)^(1/2)
 
3.1.29.2 Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan (x) \, dx=a^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )-(a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right )-b \sqrt {a+b \cot ^2(x)} \]

input
Integrate[(a + b*Cot[x]^2)^(3/2)*Tan[x],x]
 
output
a^(3/2)*ArcTanh[Sqrt[a + b*Cot[x]^2]/Sqrt[a]] - (a - b)^(3/2)*ArcTanh[Sqrt 
[a + b*Cot[x]^2]/Sqrt[a - b]] - b*Sqrt[a + b*Cot[x]^2]
 
3.1.29.3 Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.07, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.600, Rules used = {3042, 25, 4153, 25, 354, 95, 174, 73, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \tan (x) \left (a+b \cot ^2(x)\right )^{3/2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {\left (a+b \tan \left (x+\frac {\pi }{2}\right )^2\right )^{3/2}}{\tan \left (x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\left (b \tan \left (x+\frac {\pi }{2}\right )^2+a\right )^{3/2}}{\tan \left (x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 4153

\(\displaystyle \int -\frac {\tan (x) \left (a+b \cot ^2(x)\right )^{3/2}}{\cot ^2(x)+1}d\cot (x)\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\left (b \cot ^2(x)+a\right )^{3/2} \tan (x)}{\cot ^2(x)+1}d\cot (x)\)

\(\Big \downarrow \) 354

\(\displaystyle -\frac {1}{2} \int \frac {\left (b \cot ^2(x)+a\right )^{3/2} \tan (x)}{\cot ^2(x)+1}d\cot ^2(x)\)

\(\Big \downarrow \) 95

\(\displaystyle \frac {1}{2} \left (-\int \frac {\left (a^2+(2 a-b) b \cot ^2(x)\right ) \tan (x)}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot ^2(x)-2 b \sqrt {a+b \cot ^2(x)}\right )\)

\(\Big \downarrow \) 174

\(\displaystyle \frac {1}{2} \left (a^2 \left (-\int \frac {\tan (x)}{\sqrt {b \cot ^2(x)+a}}d\cot ^2(x)\right )+(a-b)^2 \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot ^2(x)-2 b \sqrt {a+b \cot ^2(x)}\right )\)

\(\Big \downarrow \) 73

\(\displaystyle \frac {1}{2} \left (-\frac {2 a^2 \int \frac {1}{\frac {\cot ^4(x)}{b}-\frac {a}{b}}d\sqrt {b \cot ^2(x)+a}}{b}+\frac {2 (a-b)^2 \int \frac {1}{\frac {\cot ^4(x)}{b}-\frac {a}{b}+1}d\sqrt {b \cot ^2(x)+a}}{b}-2 b \sqrt {a+b \cot ^2(x)}\right )\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {1}{2} \left (2 a^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a}}\right )-2 (a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \cot ^2(x)}}{\sqrt {a-b}}\right )-2 b \sqrt {a+b \cot ^2(x)}\right )\)

input
Int[(a + b*Cot[x]^2)^(3/2)*Tan[x],x]
 
output
(2*a^(3/2)*ArcTanh[Sqrt[a + b*Cot[x]^2]/Sqrt[a]] - 2*(a - b)^(3/2)*ArcTanh 
[Sqrt[a + b*Cot[x]^2]/Sqrt[a - b]] - 2*b*Sqrt[a + b*Cot[x]^2])/2
 

3.1.29.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 95
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), 
x_] :> Simp[f*((e + f*x)^(p - 1)/(b*d*(p - 1))), x] + Simp[1/(b*d)   Int[(b 
*d*e^2 - a*c*f^2 + f*(2*b*d*e - b*c*f - a*d*f)*x)*((e + f*x)^(p - 2)/((a + 
b*x)*(c + d*x))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 1]
 

rule 174
Int[(((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/(((a_.) + (b_.)*(x_))* 
((c_.) + (d_.)*(x_))), x_] :> Simp[(b*g - a*h)/(b*c - a*d)   Int[(e + f*x)^ 
p/(a + b*x), x], x] - Simp[(d*g - c*h)/(b*c - a*d)   Int[(e + f*x)^p/(c + d 
*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 354
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S 
ymbol] :> Simp[1/2   Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x 
, x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ 
[(m - 1)/2]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
3.1.29.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(340\) vs. \(2(61)=122\).

Time = 1.28 (sec) , antiderivative size = 341, normalized size of antiderivative = 4.55

method result size
default \(\frac {\sqrt {4}\, \left (\cos \left (x \right )-1\right ) \left (a +b \cot \left (x \right )^{2}\right )^{\frac {3}{2}} \left (a^{\frac {3}{2}} \sqrt {-a +b}\, \operatorname {arctanh}\left (\frac {\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cot \left (x \right )+\csc \left (x \right )\right )}{\sqrt {a}}\right ) \sin \left (x \right )-\cos \left (x \right ) \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {-a +b}\, b +\arctan \left (\frac {\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cot \left (x \right )+\csc \left (x \right )\right )}{\sqrt {-a +b}}\right ) a^{2} \sin \left (x \right )-2 \arctan \left (\frac {\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cot \left (x \right )+\csc \left (x \right )\right )}{\sqrt {-a +b}}\right ) a b \sin \left (x \right )+\arctan \left (\frac {\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cot \left (x \right )+\csc \left (x \right )\right )}{\sqrt {-a +b}}\right ) b^{2} \sin \left (x \right )-\sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {-a +b}\, b \right )}{2 \sqrt {-a +b}\, \left (a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a \right ) \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}}\) \(341\)

input
int((a+b*cot(x)^2)^(3/2)*tan(x),x,method=_RETURNVERBOSE)
 
output
1/2*4^(1/2)/(-a+b)^(1/2)*(cos(x)-1)*(a+b*cot(x)^2)^(3/2)*(a^(3/2)*(-a+b)^( 
1/2)*arctanh(1/a^(1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*(co 
t(x)+csc(x)))*sin(x)-cos(x)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2 
)*(-a+b)^(1/2)*b+arctan(1/(-a+b)^(1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x) 
+1)^2)^(1/2)*(cot(x)+csc(x)))*a^2*sin(x)-2*arctan(1/(-a+b)^(1/2)*(-(a*cos( 
x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*(cot(x)+csc(x)))*a*b*sin(x)+arctan( 
1/(-a+b)^(1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*(cot(x)+csc 
(x)))*b^2*sin(x)-(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1 
/2)*b)/(a*cos(x)^2-cos(x)^2*b-a)/(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2) 
^(1/2)
 
3.1.29.5 Fricas [A] (verification not implemented)

Time = 0.79 (sec) , antiderivative size = 565, normalized size of antiderivative = 7.53 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan (x) \, dx=\left [\frac {1}{2} \, a^{\frac {3}{2}} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt {a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + b\right ) - \frac {1}{4} \, {\left (a - b\right )}^{\frac {3}{2}} \log \left (-\frac {{\left (8 \, a^{2} - 8 \, a b + b^{2}\right )} \tan \left (x\right )^{4} + 2 \, {\left (4 \, a b - 3 \, b^{2}\right )} \tan \left (x\right )^{2} + b^{2} + 4 \, {\left ({\left (2 \, a - b\right )} \tan \left (x\right )^{4} + b \tan \left (x\right )^{2}\right )} \sqrt {a - b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{\tan \left (x\right )^{4} + 2 \, \tan \left (x\right )^{2} + 1}\right ) - b \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}, -\sqrt {-a} a \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2}}{a \tan \left (x\right )^{2} + b}\right ) - \frac {1}{4} \, {\left (a - b\right )}^{\frac {3}{2}} \log \left (-\frac {{\left (8 \, a^{2} - 8 \, a b + b^{2}\right )} \tan \left (x\right )^{4} + 2 \, {\left (4 \, a b - 3 \, b^{2}\right )} \tan \left (x\right )^{2} + b^{2} + 4 \, {\left ({\left (2 \, a - b\right )} \tan \left (x\right )^{4} + b \tan \left (x\right )^{2}\right )} \sqrt {a - b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{\tan \left (x\right )^{4} + 2 \, \tan \left (x\right )^{2} + 1}\right ) - b \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}, \frac {1}{2} \, {\left (-a + b\right )}^{\frac {3}{2}} \arctan \left (-\frac {2 \, \sqrt {-a + b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2}}{{\left (2 \, a - b\right )} \tan \left (x\right )^{2} + b}\right ) + \frac {1}{2} \, a^{\frac {3}{2}} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt {a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + b\right ) - b \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}, -\sqrt {-a} a \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2}}{a \tan \left (x\right )^{2} + b}\right ) + \frac {1}{2} \, {\left (-a + b\right )}^{\frac {3}{2}} \arctan \left (-\frac {2 \, \sqrt {-a + b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2}}{{\left (2 \, a - b\right )} \tan \left (x\right )^{2} + b}\right ) - b \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}\right ] \]

input
integrate((a+b*cot(x)^2)^(3/2)*tan(x),x, algorithm="fricas")
 
output
[1/2*a^(3/2)*log(2*a*tan(x)^2 + 2*sqrt(a)*sqrt((a*tan(x)^2 + b)/tan(x)^2)* 
tan(x)^2 + b) - 1/4*(a - b)^(3/2)*log(-((8*a^2 - 8*a*b + b^2)*tan(x)^4 + 2 
*(4*a*b - 3*b^2)*tan(x)^2 + b^2 + 4*((2*a - b)*tan(x)^4 + b*tan(x)^2)*sqrt 
(a - b)*sqrt((a*tan(x)^2 + b)/tan(x)^2))/(tan(x)^4 + 2*tan(x)^2 + 1)) - b* 
sqrt((a*tan(x)^2 + b)/tan(x)^2), -sqrt(-a)*a*arctan(sqrt(-a)*sqrt((a*tan(x 
)^2 + b)/tan(x)^2)*tan(x)^2/(a*tan(x)^2 + b)) - 1/4*(a - b)^(3/2)*log(-((8 
*a^2 - 8*a*b + b^2)*tan(x)^4 + 2*(4*a*b - 3*b^2)*tan(x)^2 + b^2 + 4*((2*a 
- b)*tan(x)^4 + b*tan(x)^2)*sqrt(a - b)*sqrt((a*tan(x)^2 + b)/tan(x)^2))/( 
tan(x)^4 + 2*tan(x)^2 + 1)) - b*sqrt((a*tan(x)^2 + b)/tan(x)^2), 1/2*(-a + 
 b)^(3/2)*arctan(-2*sqrt(-a + b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)^2/ 
((2*a - b)*tan(x)^2 + b)) + 1/2*a^(3/2)*log(2*a*tan(x)^2 + 2*sqrt(a)*sqrt( 
(a*tan(x)^2 + b)/tan(x)^2)*tan(x)^2 + b) - b*sqrt((a*tan(x)^2 + b)/tan(x)^ 
2), -sqrt(-a)*a*arctan(sqrt(-a)*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)^2/( 
a*tan(x)^2 + b)) + 1/2*(-a + b)^(3/2)*arctan(-2*sqrt(-a + b)*sqrt((a*tan(x 
)^2 + b)/tan(x)^2)*tan(x)^2/((2*a - b)*tan(x)^2 + b)) - b*sqrt((a*tan(x)^2 
 + b)/tan(x)^2)]
 
3.1.29.6 Sympy [F]

\[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan (x) \, dx=\int \left (a + b \cot ^{2}{\left (x \right )}\right )^{\frac {3}{2}} \tan {\left (x \right )}\, dx \]

input
integrate((a+b*cot(x)**2)**(3/2)*tan(x),x)
 
output
Integral((a + b*cot(x)**2)**(3/2)*tan(x), x)
 
3.1.29.7 Maxima [F]

\[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan (x) \, dx=\int { {\left (b \cot \left (x\right )^{2} + a\right )}^{\frac {3}{2}} \tan \left (x\right ) \,d x } \]

input
integrate((a+b*cot(x)^2)^(3/2)*tan(x),x, algorithm="maxima")
 
output
integrate((b*cot(x)^2 + a)^(3/2)*tan(x), x)
 
3.1.29.8 Giac [F(-2)]

Exception generated. \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan (x) \, dx=\text {Exception raised: TypeError} \]

input
integrate((a+b*cot(x)^2)^(3/2)*tan(x),x, algorithm="giac")
 
output
Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:sym2poly/r2sym(const gen & e,const 
index_m & i,const vecteur & l) Error: Bad Argument Value
 
3.1.29.9 Mupad [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 506, normalized size of antiderivative = 6.75 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan (x) \, dx=\mathrm {atanh}\left (\frac {2\,b^6\,\sqrt {a^3}\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}}{-6\,a^5\,b^3+12\,a^4\,b^4-8\,a^3\,b^5+2\,a^2\,b^6}-\frac {8\,a\,b^5\,\sqrt {a^3}\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}}{-6\,a^5\,b^3+12\,a^4\,b^4-8\,a^3\,b^5+2\,a^2\,b^6}+\frac {12\,a^2\,b^4\,\sqrt {a^3}\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}}{-6\,a^5\,b^3+12\,a^4\,b^4-8\,a^3\,b^5+2\,a^2\,b^6}-\frac {6\,a^3\,b^3\,\sqrt {a^3}\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}}{-6\,a^5\,b^3+12\,a^4\,b^4-8\,a^3\,b^5+2\,a^2\,b^6}\right )\,\sqrt {a^3}-\mathrm {atanh}\left (\frac {2\,a\,b^5\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}\,\sqrt {a^3-3\,a^2\,b+3\,a\,b^2-b^3}}{6\,a^5\,b^3-18\,a^4\,b^4+20\,a^3\,b^5-10\,a^2\,b^6+2\,a\,b^7}-\frac {6\,a^2\,b^4\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}\,\sqrt {a^3-3\,a^2\,b+3\,a\,b^2-b^3}}{6\,a^5\,b^3-18\,a^4\,b^4+20\,a^3\,b^5-10\,a^2\,b^6+2\,a\,b^7}+\frac {6\,a^3\,b^3\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}}\,\sqrt {a^3-3\,a^2\,b+3\,a\,b^2-b^3}}{6\,a^5\,b^3-18\,a^4\,b^4+20\,a^3\,b^5-10\,a^2\,b^6+2\,a\,b^7}\right )\,\sqrt {{\left (a-b\right )}^3}-b\,\sqrt {a+\frac {b}{{\mathrm {tan}\left (x\right )}^2}} \]

input
int(tan(x)*(a + b*cot(x)^2)^(3/2),x)
 
output
atanh((2*b^6*(a^3)^(1/2)*(a + b/tan(x)^2)^(1/2))/(2*a^2*b^6 - 8*a^3*b^5 + 
12*a^4*b^4 - 6*a^5*b^3) - (8*a*b^5*(a^3)^(1/2)*(a + b/tan(x)^2)^(1/2))/(2* 
a^2*b^6 - 8*a^3*b^5 + 12*a^4*b^4 - 6*a^5*b^3) + (12*a^2*b^4*(a^3)^(1/2)*(a 
 + b/tan(x)^2)^(1/2))/(2*a^2*b^6 - 8*a^3*b^5 + 12*a^4*b^4 - 6*a^5*b^3) - ( 
6*a^3*b^3*(a^3)^(1/2)*(a + b/tan(x)^2)^(1/2))/(2*a^2*b^6 - 8*a^3*b^5 + 12* 
a^4*b^4 - 6*a^5*b^3))*(a^3)^(1/2) - atanh((2*a*b^5*(a + b/tan(x)^2)^(1/2)* 
(3*a*b^2 - 3*a^2*b + a^3 - b^3)^(1/2))/(2*a*b^7 - 10*a^2*b^6 + 20*a^3*b^5 
- 18*a^4*b^4 + 6*a^5*b^3) - (6*a^2*b^4*(a + b/tan(x)^2)^(1/2)*(3*a*b^2 - 3 
*a^2*b + a^3 - b^3)^(1/2))/(2*a*b^7 - 10*a^2*b^6 + 20*a^3*b^5 - 18*a^4*b^4 
 + 6*a^5*b^3) + (6*a^3*b^3*(a + b/tan(x)^2)^(1/2)*(3*a*b^2 - 3*a^2*b + a^3 
 - b^3)^(1/2))/(2*a*b^7 - 10*a^2*b^6 + 20*a^3*b^5 - 18*a^4*b^4 + 6*a^5*b^3 
))*((a - b)^3)^(1/2) - b*(a + b/tan(x)^2)^(1/2)